import express from 'express';

const app = express();
const port = process.env.HEALTHY_PORT || 9000;

// healthy check point
app.get('/ready', (req, res) => {
    res.status(200).send('Ready');
});

app.get('/alive', (req, res) => {
    res.status(200).send('Alive');
});

// Start Express service
function startHealthCheckServer() {
    app.listen(port, () => {
        console.log('Health check server listening on port ${port}');
    });
}

export default startHealthCheckServer
